Skip to content

fix(contract+ogar): mirror OGAR #110 auth domain + bump workspace Cargo.lock — restores q2 build parity#596

Closed
AdaWorldAPI wants to merge 1 commit into
mainfrom
claude/contract-codebook-mirror-add-auth-domain-from-ogar-110
Closed

fix(contract+ogar): mirror OGAR #110 auth domain + bump workspace Cargo.lock — restores q2 build parity#596
AdaWorldAPI wants to merge 1 commit into
mainfrom
claude/contract-codebook-mirror-add-auth-domain-from-ogar-110

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Drift fix (D — surfaced by q2 #42's pin bump)

The chain that exposed the drift:

  1. OGAR PR feat: MoE architecture — 4096 experts, top-128 sparse, 4-group hierarchy 4096 experts → router selects top-128 → each runs 16 internal layers → 4 hierarchical groups where expert outputs compose → collapse → token Architecture maps Qwopus's actual MoE structure: Router: 4096×4096 input distance table (which experts respond?) Expert internals: 256×256 per-layer tables (how does each expert think?) Sparse activation: only top-128 of 4096 fire (97% sparsity) Hierarchical meeting: experts compose at 4 intermediate points Performance: 42s for 3 prompts in release (128×16 MatVec per token) → production needs SIMD batching or GPU Output quality still blocked by attractor collapse ("!" dominates). Needs: thinking style temperature + persona routing + ONNX gate correction. https://claude.ai/code/session_01ChLvBfpJS8dQhHxRD4pYNp #110 (2026-06-23) added 4 entries (auth_store, auth_zitadel,
    auth_zanzibar, auth_ory_keto at 0x0B01-0x0B04) to
    ogar_vocab::class_ids::ALL + minted ConceptDomain::Auth.
  2. lance-graph-contract::ogar_codebook::CODEBOOK is the wire-compatible
    mirror
    of OGAR's codebook (per feat(contract): mirror OGAR APP-prefix (hi-u16) layer into ogar_codebook (closes ISS-CONTRACT-APP-PREFIX-MIRROR) #592 — the APP-prefix layer joined it).
    The mirror was NOT updated when feat: MoE architecture — 4096 experts, top-128 sparse, 4-group hierarchy 4096 experts → router selects top-128 → each runs 16 internal layers → 4 hierarchical groups where expert outputs compose → collapse → token Architecture maps Qwopus's actual MoE structure: Router: 4096×4096 input distance table (which experts respond?) Expert internals: 256×256 per-layer tables (how does each expert think?) Sparse activation: only top-128 of 4096 fire (97% sparsity) Hierarchical meeting: experts compose at 4 intermediate points Performance: 42s for 3 prompts in release (128×16 MatVec per token) → production needs SIMD batching or GPU Output quality still blocked by attractor collapse ("!" dominates). Needs: thinking style temperature + persona routing + ONNX gate correction. https://claude.ai/code/session_01ChLvBfpJS8dQhHxRD4pYNp #110 landed.
  3. lance-graph's local Cargo.lock pinned ogar-vocab to 08a9c979
    (pre-feat: MoE architecture — 4096 experts, top-128 sparse, 4-group hierarchy 4096 experts → router selects top-128 → each runs 16 internal layers → 4 hierarchical groups where expert outputs compose → collapse → token Architecture maps Qwopus's actual MoE structure: Router: 4096×4096 input distance table (which experts respond?) Expert internals: 256×256 per-layer tables (how does each expert think?) Sparse activation: only top-128 of 4096 fire (97% sparsity) Hierarchical meeting: experts compose at 4 intermediate points Performance: 42s for 3 prompts in release (128×16 MatVec per token) → production needs SIMD batching or GPU Output quality still blocked by attractor collapse ("!" dominates). Needs: thinking style temperature + persona routing + ONNX gate correction. https://claude.ai/code/session_01ChLvBfpJS8dQhHxRD4pYNp #110, 39 entries) — local build worked because mirror == ALL == 39.
  4. q2 feat(planner): internal API — Planner + CamSearch (same-binary, zero-serde) api.rs: - Planner: plan(), plan_with_style(), plan_assessed(), gate_check() - CamSearch: prepare_query(), top_k(), encode(), decode(), stats() - Gate re-export (Proceed/Sandbox/Compass) - All direct fn calls, no HTTP/IPC/serialization 51 tests passing (43 existing + 8 new API tests). https://claude.ai/code/session_01BTATTRUACijvsK4hqmKUBR #42 bumped q2's stale OGAR pin (b6a12a6302c284). q2's Railway
    docker build then ran cargo build against lance-graph HEAD (mirror=39)
    • OGAR 302c284 (ALL=43). lance_graph_ogar::parity::COUNT_FUSE
      const-eval-panicked.

The local build was silently masking the drift.

Three coordinated fixes

1. lance-graph-contract::ogar_codebook — mirror parity

2. lance-graph-ogar::parity::domains_agree — new arm

The matches!() macro used explicit (O::X, C::X) arms per variant; the
new Auth variant on both sides falls through to default-false without an
explicit arm. Added (O::Auth, C::Auth).

Without this fix the runtime assert_codebook_parity() panics with
domain disagreement for auth_store (0x0b01) even with the CODEBOOK fix.

3. Workspace Cargo.lock — OGAR pin bump

Bumped ogar-vocab / ogar-class-view / ogar-ontology /
ogar-adapter-surrealql from 08a9c979302c284 (current OGAR main,
PR #110 merge). 4 references in this lock.

Safe SHA swap verified — Cargo.toml deps byte-identical between commits:

$ git -C ogar diff 08a9c979..302c284 -- crates/{ogar-vocab,ogar-class-view,ogar-ontology,ogar-adapter-surrealql}/Cargo.toml
# returns EMPTY

Same fix pattern as q2 #42 (which bumped q2's own Cargo.lock with the same
SHA range). The crates/lance-graph-ogar/Cargo.lock (excluded-from-workspace
own-root lock) is .gitignored; locally I bumped it for the test run,
consumers regenerate from their own cargo build.

Tests

  • cargo test -p lance-graph-contract: 9 doctests pass (compile-time fuse passes)
  • cargo test --lib in crates/lance-graph-ogar: 53/53 pass, including
    parity::tests::mirror_is_a_faithful_copy_of_ogar_codebook (the runtime
    full-bijection check)
  • cargo build -p lance-graph-ogar: clean

Board-Hygiene per Mandatory Rule

.claude/board/EPIPHANIES.md prepended with E-OGAR-AUTH-MIRROR-DRIFT
(Status: FINDING). Captures the standing reminder: the mirror must be
updated in the SAME commit as any OGAR-side ALL-list extension
. The
COUNT_FUSE is the guardrail when it fires locally (matching pins); the
q2-side build was the guardrail that fired this time, two days late.

Source-of-finding

Related

Summary by CodeRabbit

  • Bug Fixes

    • Resolved a synchronization issue between authentication domain definitions that was causing build failures during dependency updates.
  • Chores

    • Updated package dependencies to align with latest authentication vocabulary definitions.

…go.lock → restore q2 build parity

OGAR PR #110 (2026-06-23, AuthStore class family) added 4 entries to
`ogar_vocab::class_ids::ALL` (auth_store 0x0B01, auth_zitadel 0x0B02,
auth_zanzibar 0x0B03, auth_ory_keto 0x0B04) and a `ConceptDomain::Auth`
variant. The `lance-graph-contract::ogar_codebook` wire-compatible mirror
was not updated when #110 landed — a 4-entry drift sat in main from
2026-06-23 until exposed by q2 #42's pin bump.

The q2 Railway build (against the bumped `302c284` OGAR pin + latest
lance-graph main) fired `lance_graph_ogar::parity::COUNT_FUSE`:
`mirror::CODEBOOK.len() (39) != ogar_vocab::class_ids::ALL.len() (43)`.

Three coordinated fixes:

1. lance-graph-contract: extend `ogar_codebook::CODEBOOK` with the 4
   auth_* entries; add `ConceptDomain::Auth` variant; add `0x0B → Auth`
   to `canonical_concept_domain`; refresh the module-doc count from
   "two domains" → "four domains" (stale since the Health 0x09XX
   promotion).

2. lance-graph-ogar: `parity::domains_agree`'s `matches!()` had explicit
   `(O::X, C::X)` arms — needed an `(O::Auth, C::Auth)` arm. Without it,
   the runtime `assert_codebook_parity()` panics with
   "domain disagreement for auth_store (0x0b01)".

3. workspace Cargo.lock: bump pinned ogar-vocab / ogar-class-view /
   ogar-ontology / ogar-adapter-surrealql from `08a9c979` → `302c284`
   (current OGAR main, PR #110 merge). 4 references in this lock.
   Safe SHA swap verified: Cargo.toml deps byte-identical between commits.

   (The `crates/lance-graph-ogar/Cargo.lock` own-root lock is gitignored
    and needs the same bump locally; the workspace lock + ogar-vocab
    branch="main" git dep means consumer locks float to the latest commit
    on main — q2 already pins `302c284` which has the parity-compatible
    surface.)

Tests:
  - lance-graph-contract: 9 doctests pass (compile-time fuse passes)
  - lance-graph-ogar lib: 53/53 pass, including
    `parity::tests::mirror_is_a_faithful_copy_of_ogar_codebook`
  - `cargo build -p lance-graph-ogar`: clean

EPIPHANIES.md updated per Mandatory Board-Hygiene Rule with
E-OGAR-AUTH-MIRROR-DRIFT — names the standing reminder that the mirror
must be updated in the SAME commit as any OGAR-side ALL-list extension.

Source-of-finding:
  - q2 Railway build error post-bump (the cross-pin coordination canary)
  - OGAR PR #110 (introduced the drift; merged 2026-06-23)
  - lance-graph #592 (introduced the mirror pattern; the parity guard)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR syncs the lance-graph-contract OGAR codebook mirror to OGAR PR #110 by adding ConceptDomain::Auth, mapping high byte 0x0B in canonical_concept_domain, and appending four auth_* concept IDs to CODEBOOK. The domains_agree predicate in lance-graph-ogar gains the matching (O::Auth, C::Auth) arm. A new EPIPHANIES.md entry documents the drift and fix.

Changes

OGAR Auth Domain Mirror Sync

Layer / File(s) Summary
Auth domain variant and CODEBOOK entries
crates/lance-graph-contract/src/ogar_codebook.rs
ConceptDomain::Auth variant added; canonical_concept_domain maps high byte 0x0B to it; CODEBOOK docs updated to list four surfaced domains; four auth_* entries (auth_store, auth_zitadel, auth_zanzibar, auth_ory_keto) appended under 0x0BXX.
domains_agree Auth arm
crates/lance-graph-ogar/src/lib.rs
parity::domains_agree match table extended with (O::Auth, C::Auth) to recognize the new Auth domain as agreeing across OGAR and the contract mirror.
Drift root cause documentation
.claude/board/EPIPHANIES.md
New E-OGAR-AUTH-MIRROR-DRIFT epiphany entry records how the q2 pin bump exposed the COUNT_FUSE mismatch, the two complementary fixes, the ogar-vocab Cargo.lock bump, and test results.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • AdaWorldAPI/lance-graph#563: Modifies the same ogar_codebook.rs mirror machinery (ConceptDomain, CODEBOOK, canonical_concept_domain) and domain-alignment logic that this PR extends with the Auth domain.

Poem

🐇 Hippity-hop, the codebook was short,
Auth entries missing — a compile-time retort!
Four auth_* IDs now hop into place,
domains_agree smiles with its new matching face.
The COUNT_FUSE rests, no mismatch in sight —
The mirror reflects OGAR exactly right! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changeset: fixing contract+OGAR synchronization by mirroring the auth domain from OGAR #110 and bumping workspace Cargo.lock to restore q2 build parity.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch claude/contract-codebook-mirror-add-auth-domain-from-ogar-110

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
crates/lance-graph-contract/src/ogar_codebook.rs (1)

77-77: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a focused unit assertion for the new 0x0B domain route.

Line 77 adds a new routing arm; please add a direct 0x0B01 -> ConceptDomain::Auth assertion in the local domain_routes_on_high_byte test to keep the guard explicit in this crate.

Suggested test addition
 #[test]
 fn domain_routes_on_high_byte() {
     assert_eq!(canonical_concept_domain(0x0000), ConceptDomain::Reserved);
     assert_eq!(canonical_concept_domain(0x0101), ConceptDomain::ProjectMgmt);
     assert_eq!(canonical_concept_domain(0x0206), ConceptDomain::Commerce);
     assert_eq!(canonical_concept_domain(0x0700), ConceptDomain::Osint);
     assert_eq!(canonical_concept_domain(0x0801), ConceptDomain::Ocr);
     assert_eq!(canonical_concept_domain(0x0901), ConceptDomain::Health);
+    assert_eq!(canonical_concept_domain(0x0B01), ConceptDomain::Auth);
     assert_eq!(canonical_concept_domain(0x0500), ConceptDomain::Unassigned);
 }

As per coding guidelines, crates/**/*.rs changes should include focused unit tests alongside implementations.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/lance-graph-contract/src/ogar_codebook.rs` at line 77, Add a focused
unit test assertion to the existing `domain_routes_on_high_byte` test function
that directly validates the new routing case added at line 77. Create an
assertion that verifies when the input is 0x0B01, the routing correctly maps to
ConceptDomain::Auth, ensuring the guard for this new routing arm is explicit and
testable within this crate.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@crates/lance-graph-contract/src/ogar_codebook.rs`:
- Line 77: Add a focused unit test assertion to the existing
`domain_routes_on_high_byte` test function that directly validates the new
routing case added at line 77. Create an assertion that verifies when the input
is 0x0B01, the routing correctly maps to ConceptDomain::Auth, ensuring the guard
for this new routing arm is explicit and testable within this crate.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: abb7257a-6b9e-4ce2-b147-dd2d187842a9

📥 Commits

Reviewing files that changed from the base of the PR and between 36059ce and 2dea858.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • .claude/board/EPIPHANIES.md
  • crates/lance-graph-contract/src/ogar_codebook.rs
  • crates/lance-graph-ogar/src/lib.rs

@AdaWorldAPI

Copy link
Copy Markdown
Owner Author

Superseded by #597. The OGAR #110 mirror (auth_*) shipped via a sibling D1 (81d08c42); #597 carries the next scoped follow-up (OGAR #111 → PRODUCT + ACCOUNTING_ACCOUNT mirror + workspace Cargo.lock bump to ac4b4162). Closing this in favor of the rebased, smaller-scope #597.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants